var _SyncMLLoginTemplate='chrome://thundernote/content/syncml_login.txt';



if (typeof(__SYNCMLB)!='boolean')
{
  var __SYNCMLB=true;
  
  var __SYNCML={
  
    __apiVersion : '1.0',
    __lastError : '',
    
    getDSVersion : function(url)
    {
      var RetVal=null;
      __SYNCML.__lastError='';

      
      if(__AJAX.HEAD(url))
        RetVal=__AJAX.getResponseHeader('X-funambol-ds-server');
      else
        __SYNCML.__lastError=__AJAX.getLastError();
      

      /*
      var creds=uid+":"+password;
      var b64creds=encode64(creds);
      var message;

      alert(creds);
      alert(b64creds);
      
      __SYNCML.__lastError='';

      message=readRawThunderNoteFile(_SyncMLLoginTemplate);


      alert(message);
      message=message.replace(/{CRED}/g,b64creds);
      
      alert(message);
      
      
      var request =  new XMLHttpRequest();
      
      //request.open('HEAD','http://server:8080/funambol/ds/Note',false);
      request.open('GET','http://server:8080/funambol/ds',false);
      request.setRequestHeader("Content-type", "application/vnd.syncml+xml");
      request.setRequestHeader("Content-length", message.length);
      request.setRequestHeader("Connection", "close");
      //request.onreadystatechange = function() {//Call a function when the state changes.
    	//if(request.readyState == 4 && request.status == 200) {
  	 	//request.send(null);
      request.send(message);
      alert(request.responseText);
  	 	alert(request.status);
  	   //}
      //}
      //request.send(fileContents2);
      //request.send(null);
      alert('xxx');

      */


      return(RetVal);
    },
    
    getLastError : function()
    {
      return(__SYNCML.__lastError);
    },
    
    getApiVersion : function()
    {
      return(__SYNCML.__apiVersion);
    }
    
  }
}